﻿using System;
using System.Text.RegularExpressions;

namespace ExchangeRateService.Helpers
{
	/// <summary>
	/// Description of RegexUtils.
	/// </summary>
	public static class RegexUtils
	{
		public static Boolean IsDoubleType(String value)
        {
        	if (IsStringMissing(value))
        		return false;
        	
        	String pattern = @"/^([-]?)([0-9]+)((.[0-9]{2})?)$/";
        	
        	return Regex.IsMatch(value, pattern);
        }
        
        public static Boolean IsStringMissing(String value)
        {
        	return String.IsNullOrEmpty(value) || value.Trim() == String.Empty;
        }
	}
}
